#!/usr/bin/env python
import os
import sys
import time
import requests

log_file_path = os.path.abspath(sys.argv[1])
crawler_id = "log-id-{}".format(time.time())

url = "http://localhost:9000/admin/add-log"
data = {
  'crawler_id': crawler_id,
  'path': log_file_path
}

print "Sending...", data

result = requests.post(url, data=data)
print "Got...", result.status_code
if( result.status_code != 200):
  print "Got...", result.text

